#ifndef SMALLCARDB_H
#define SMALLCARDB_H

#include "odom_slam.h"
#include "odom_gps.h"
#include "odom_imu.h"
#include <iostream>
#include <string>
#include <mysql/mysql.h>
#include <list>

using namespace std;


class smallcardb{

public:

     smallcardb();
    ~smallcardb();

    void  car_db_init();
    MYSQL* get_mysql_conn();
    void   set_mysql_conn(MYSQL* my_conn);
    MYSQL_RES* get_mysql_res();
    void  set_mysql_res(MYSQL_RES* my_res);
    MYSQL_ROW  get_mysql_row();
    void  set_mysql_row(MYSQL_ROW my_row);
 
    void  Add_odom_slam(odom_slam  *Odom_slam);
    void  Update_odom_slam(int timestamp);
    void  Delete_odom_slam(float  start_x_axes,float end_x_axes);
    list<odom_slam> getScroll_SlamData(float  start_x_axes,float end_x_axes);


    void  Add_odom_gps(odom_gps  *Odom_gps);
    void  Update_odom_gps(int timestamp);
    void  Delete_odom_gps(float  start_x_axes,float end_x_axes);
    list<odom_gps> getScroll_GpsData(float  start_x_axes,float end_x_axes);

    void  Add_odom_imu(odom_imu  *Odom_imu);
    void  Update_odom_imu(int timestamp);
    void  Delete_odom_imu(float  start_x_axes,float end_x_axes);
    list<odom_imu> getScroll_ImuData(float  start_x_axes,float end_x_axes);

private:

    MYSQL *conn;
    MYSQL_RES *res;
    MYSQL_ROW row;
};

#endif 

